package com.array;


import java.util.Arrays;

public class array06 {
    public static void main(String[] args) {
        int[] a = {1,3,4,5,5555,6,7};
        System.out.println(a);
    //打印数组元素 Arrays.toString
        System.out.println(Arrays.toString(a));
        printArray(a);
        Arrays.sort(a);//数组进行排序：升序
        System.out.println(Arrays.toString(a));

        Arrays.fill(a,2,4,0);//数组填充
        System.out.println(Arrays.toString(a));

    }
    public static void printArray(int[] a){
        for (int i = 0; i < a.length; i++) {
            if (i==0){
                System.out.print("[");
            }
            if (i==a.length-1){
                System.out.print(a[i]+"]");
            }else {
                System.out.print(a[i]+", ");
            }

        }
    }
}
